import jagex.CacheLoader;
import jagex.DataOperations;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;



/**
 * TODO
 * Cache needs to be unpacked into <xml></xml> format! So that we can begin the process of 
 * creating a proper server.
 */

public class Cache {
	
	public static void main(String args[]) {
		loadGameCache();
	}

	public static void loadGameCache() {
		try {
			loadProjectiles(new CacheLoader("../gamedata/config/projectile.txt"));
			loadAnimations(new CacheLoader("../gamedata/config/entity.txt"));
			loadItems(new CacheLoader("../gamedata/config/objects.txt"));
			loadNpcs(new CacheLoader("../gamedata/config/npc.txt"));
			loadObjects(new CacheLoader("../gamedata/config/location.txt"));
			loadBoundarys(new CacheLoader("../gamedata/config/boundary.txt"));
			loadRoof(new CacheLoader("../gamedata/config/roof.txt"));
			loadFloors(new CacheLoader("../gamedata/config/floor.txt"));
			loadSpells(new CacheLoader("../gamedata/config/spells.txt"));
			loadShops(new CacheLoader("../gamedata/config/shop.txt"));
			vo();
			return;
		} catch (IOException ioexception) {
			System.out.println("Error loading config files");
			ioexception.printStackTrace();
			return;
		}
	}

	public static void oo(byte arg0[]) {
		try {
			loadProjectiles(new CacheLoader(arg0, DataOperations.mm(
					"projectile.txt", arg0)));
			loadAnimations(new CacheLoader(arg0, DataOperations.mm(
					"entity.txt", arg0)));
			loadItems(new CacheLoader(arg0, DataOperations.mm("objects.txt",
					arg0)));
			loadNpcs(new CacheLoader(arg0, DataOperations.mm("npc.txt", arg0)));
			loadObjects(new CacheLoader(arg0, DataOperations.mm(
					"location.txt", arg0)));
			loadBoundarys(new CacheLoader(arg0, DataOperations.mm(
					"boundary.txt", arg0)));
			loadRoof(new CacheLoader(arg0, DataOperations.mm("roof.txt", arg0)));
			loadFloors(new CacheLoader(arg0, DataOperations.mm("floor.txt",
					arg0)));
			loadSpells(new CacheLoader(arg0, DataOperations.mm("spells.txt",
					arg0)));
			loadShops(new CacheLoader(arg0, DataOperations.mm("shop.txt", arg0)));
			vo();
			return;
		} catch (IOException ioexception) {
			System.out.println("Error loading config files");
			ioexception.printStackTrace();
			return;
		}
	}

	public static void loadShops(CacheLoader cachedShops) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Shops.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		String line = System.getProperty("line.separator");
		cachedShops.qb();
		int shopCount = cachedShops.vb();
		totalShops = shopCount;
		System.out.println("Found " + shopCount + " shops");
		shopName = new String[shopCount];
		bkb = new int[shopCount];
		fkb = new int[shopCount];
		ckb = new int[shopCount];
		dkb = new int[shopCount];
		ekb = new int[shopCount];
		shopItemID = new int[shopCount][40];
		shopItemAmount = new int[shopCount][40];
		shopItemPrice = new int[shopCount][40];
		for (int j = 0; j < shopCount; j++) {
			cachedShops.qb();
			shopName[j] = cachedShops.wb();
			out.write("shopName = " + shopName[j] + line);
			int k = bkb[j] = cachedShops.vb();
			out.write("bkb = " + bkb[j] + line);
			ckb[j] = cachedShops.vb();
			out.write("ckb = " + ckb[j] + line);
			dkb[j] = cachedShops.vb();
			out.write("dkb = " + dkb[j] + line);
			ekb[j] = cachedShops.vb();
			out.write("ekb = " + ekb[j] + line);
			fkb[j] = cachedShops.vb();
			out.write("fkb = " + fkb[j] + line);
			for (int shopItems = 0; shopItems < k; shopItems++) {
				cachedShops.qb();
				shopItemID[j][shopItems] = go(cachedShops.wb());
				out.write("shopItemID = " + shopItemID[j][shopItems] + line);
				shopItemAmount[j][shopItems] = cachedShops.vb();
				out.write("shopItemAmount = " + shopItemAmount[j][shopItems]
						+ line);
				shopItemPrice[j][shopItems] = cachedShops.vb();
				out.write("shopItemPrice = " + shopItemPrice[j][shopItems]
						+ line);
			}
			out.write(line + line);
		}
		out.close();
	}

	public static void loadSpells(CacheLoader cachedSpells) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Spells.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		String line = System.getProperty("line.separator");
		cachedSpells.qb();
		int i = cachedSpells.vb();
		qjb = i;
		System.out.println("Found " + i + " spells");
		rjb = new String[i];
		sjb = new String[i];
		tjb = new int[i]; //spell level???
		vjb = new int[i];
		wjb = new int[i];
		ujb = new int[i];
		xjb = new int[i][]; //might be runes amount required?
		yjb = new int[i][];
		for (int j = 0; j < i; j++) {
			cachedSpells.qb();
			rjb[j] = cachedSpells.wb();
			tjb[j] = cachedSpells.vb();
			sjb[j] = cachedSpells.wb();
			vjb[j] = cachedSpells.vb();
			wjb[j] = cachedSpells.vb();
			cachedSpells.qb();
			int k = ujb[j] = cachedSpells.vb();
			xjb[j] = new int[k];
			yjb[j] = new int[k];
			for (int l = 0; l < k; l++) {
				xjb[j][l] = go(cachedSpells.wb());
				yjb[j][l] = cachedSpells.vb();
			}

		}

		cachedSpells.closeStream();
	}

	public static void loadProjectiles(CacheLoader cachedProjectiles) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Projectiles.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		String line = System.getProperty("line.separator");
		
		cachedProjectiles.qb();
		int i = cachedProjectiles.vb();
		gjb = i;
		System.out.println("Found " + i + " projectiles");
		ijb = new String[i];
		jjb = new String[i];
		kjb = new int[i];
		ljb = new int[i];
		mjb = new int[i];
		njb = new int[i];
		ojb = new int[i];
		pjb = new int[i];
		for (int j = 0; j < i; j++) {
			cachedProjectiles.qb();
			ijb[j] = cachedProjectiles.wb();
			kjb[j] = cachedProjectiles.vb();
			ljb[j] = cachedProjectiles.vb();
			mjb[j] = cachedProjectiles.vb();
			njb[j] = cachedProjectiles.vb();
			jjb[j] = cachedProjectiles.wb();
			pjb[j] = cachedProjectiles.vb();
			if (kjb[j] + 1 > hjb) {
				hjb = kjb[j] + 1;
			}
		}

		cachedProjectiles.closeStream();
	}

	public static void vo() {
		for (int i = 0; i < gjb; i++) {
			ojb[i] = go(jjb[i]);
		}

	}

	public static void loadAnimations(CacheLoader cachedAnimations) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Animations.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		String line = System.getProperty("line.separator");
		cachedAnimations.qb();
		int animationCount = cachedAnimations.vb();
		totalEntities = animationCount;
		System.out.println("Found " + animationCount + " Animations");
		animationName = new String[animationCount];
		animationType = new String[animationCount];
		genderModel = new int[animationCount];
		animationColor = new int[animationCount];
		xhb = new int[animationCount];
		animationNumber = new int[animationCount];
		zhb = new int[animationCount];
		for (int j = 0; j < animationCount; j++) {
			cachedAnimations.qb();
			animationName[j] = cachedAnimations.wb();
			out.write("animationName = " + animationName[j] + line);
			animationType[j] = cachedAnimations.wb();
			out.write("animationType = " + animationType[j] + line);
			animationColor[j] = cachedAnimations.rb();
			out.write("Animation Color = " + animationColor[j] + line);
			genderModel[j] = cachedAnimations.vb();
			out.write("genderModel = " + genderModel[j] + line);
			xhb[j] = cachedAnimations.vb();
			out.write("xhb = " + xhb[j] + line);
			animationNumber[j] = cachedAnimations.vb();
			out.write("yhb = " + animationNumber[j] + line);
		}
		out.close();
		cachedAnimations.closeStream();
	}

	public static void loadNpcs(CacheLoader cachedNpcs) throws IOException {
		cachedNpcs.qb();
		int npcCount = cachedNpcs.vb();
		totalNpcs = npcCount;
		System.out.println("Found " + npcCount + " npcs");
		npcName = new String[npcCount];
		npcExamine = new String[npcCount][];
		npcAttack = new int[npcCount];
		npcStrength = new int[npcCount];
		npcDefense = new int[npcCount];
		npcHits = new int[npcCount];
		vgb = new int[npcCount];
		wgb = new int[npcCount];
		xgb = new int[npcCount];
		ygb = new int[npcCount];
		zgb = new int[npcCount];
		ahb = new int[npcCount];
		bhb = new int[npcCount];
		chb = new int[npcCount];
		dhb = new int[npcCount];
		ehb = new int[npcCount];
		fhb = new int[npcCount];
		npcSprites = new int[npcCount][12];
		hhb = new int[npcCount];
		ihb = new int[npcCount];
		jhb = new int[npcCount];
		khb = new int[npcCount];
		camera1 = new int[npcCount];
		camera2 = new int[npcCount];
		npcWalkModels = new int[npcCount];
		npcCombatModels = new int[npcCount];
		npcCombatSprites = new int[npcCount];
		npcDropID = new int[npcCount][];
		npcDropAmount = new int[npcCount][];
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "NPCs.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		String newline = System.getProperty("line.separator");
		for (int npcID = 0; npcID < npcCount; npcID++) {
			cachedNpcs.qb();
			int k = cachedNpcs.vb();
			npcName[npcID] = cachedNpcs.wb();
			npcExamine[npcID] = new String[k];
			for (int l = 0; l < k; l++) {
				npcExamine[npcID][l] = cachedNpcs.wb();
			}
			cachedNpcs.qb();
			npcAttack[npcID] = cachedNpcs.vb();
			npcStrength[npcID] = cachedNpcs.vb();
			npcDefense[npcID] = cachedNpcs.vb();
			npcHits[npcID] = cachedNpcs.vb();
			vgb[npcID] = cachedNpcs.vb();
			wgb[npcID] = cachedNpcs.vb();
			xgb[npcID] = cachedNpcs.vb();
			ygb[npcID] = cachedNpcs.vb();
			zgb[npcID] = cachedNpcs.vb();
			ahb[npcID] = cachedNpcs.vb();
			bhb[npcID] = cachedNpcs.vb();
			chb[npcID] = cachedNpcs.vb();
			dhb[npcID] = cachedNpcs.vb();
			ehb[npcID] = cachedNpcs.vb();
			fhb[npcID] = cachedNpcs.vb();
			cachedNpcs.qb();
			for (int i1 = 0; i1 < 12; i1++) {
				npcSprites[npcID][i1] = no(cachedNpcs.wb());
			}
			hhb[npcID] = cachedNpcs.rb();
			ihb[npcID] = cachedNpcs.rb();
			jhb[npcID] = cachedNpcs.rb();
			khb[npcID] = cachedNpcs.rb();
			cachedNpcs.qb();
			camera1[npcID] = cachedNpcs.vb();
			camera2[npcID] = cachedNpcs.vb();
			npcWalkModels[npcID] = cachedNpcs.vb();
			npcCombatModels[npcID] = cachedNpcs.vb();
			npcCombatSprites[npcID] = cachedNpcs.vb();
			cachedNpcs.qb();
			int numberOfDrops = cachedNpcs.vb();
			npcDropID[npcID] = new int[numberOfDrops];
			npcDropAmount[npcID] = new int[numberOfDrops];
			for (int loop = 0; loop < numberOfDrops; loop++) {
				npcDropID[npcID][loop] = go(cachedNpcs.wb());
				npcDropAmount[npcID][loop] = cachedNpcs.vb();

			}
		}
		out.close();
		cachedNpcs.closeStream();
	}

	public static void loadItems(CacheLoader cache) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Items.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		cache.qb();
		int itemCount = cache.vb();
		totalItems = itemCount;
		System.out.println("Found " + itemCount + " Items");
		itemNames = new String[itemCount][];
		itemExamine = new String[itemCount];
		itemCommand = new String[itemCount];
		ItemIDS = new int[itemCount];
		itemPrice = new int[itemCount];
		itemStackable = new int[itemCount];
		cgb = new int[itemCount];
		dgb = new int[itemCount];
		egb = new int[itemCount];
		fgb = new int[itemCount];
		ggb = new int[itemCount];
		hgb = new int[itemCount];
		igb = new int[itemCount];
		jgb = new int[itemCount];
		kgb = new int[itemCount];
		itemPictureMask = new int[itemCount];
		mgb = new int[itemCount];
		ngb = new int[itemCount];

		String line = System.getProperty("line.separator");

		for (int id = 0; id < itemCount; id++) {
			cache.qb();
			int k = cache.vb();
			itemNames[id] = new String[k];
			for (int type = 0; type < k; type++) {
				itemNames[id][type] = cache.wb();
				if (k == 1) {
					out.write("<itemDef>" + line + "\t<itemName>" + itemNames[id][type] + "</itemName>" + line);
				} else {
					for (int i = 0; i < type; i++) {
						out.write("<itemDef>" + line + "\t<itemName>" + itemNames[id][i] + "</itemName>" + line + "\t<itemType>" + itemNames[id][type] + "</itemType>" + line);
					}
				}
			}
			itemExamine[id] = cache.wb();
			out.write("\t<itemExamine>" + itemExamine[id] + "</itemExamine>" + line);
			cache.qb();
			ItemIDS[id] = cache.vb();
			out.write("\t<itemID>" + ItemIDS[id] + "</itemID>" + line);
			if (ItemIDS[id] >= ufb) {
				ufb = ItemIDS[id] + 1;
			}
			itemPrice[id] = cache.vb();
			out.write("\t<itemPrice>" + itemPrice[id] + "</itemPrice>" + line);
			itemStackable[id] = cache.vb();
			out.write("\t<itemStackable>" + itemStackable[id] + "</itemStackable>" + line);
			itemCommand[id] = cache.wb();
			out.write("\t<itemCommand>" + (itemCommand[id].equals("_") ? "" : itemCommand[id]) + "</itemCommand>" + line);
			cache.qb();
			cgb[id] = cache.vb();
			out.write("[UNKNOWN]cgb = " + cgb[id] + line);
			dgb[id] = cache.vb();
			out.write("[UNKNOWN]dgb = " + dgb[id] + line);
			egb[id] = cache.vb();
			out.write("[UNKNOWN]egb = " + egb[id] + line);
			fgb[id] = cache.vb();
			out.write("[UNKNOWN]fgb = " + fgb[id] + line);
			ggb[id] = cache.vb();
			out.write("[UNKNOWN]ggb = " + ggb[id] + line);
			hgb[id] = cache.vb();
			out.write("[UNKNOWN]hgb = " + hgb[id] + line);
			igb[id] = jo(cache.wb()) + 1;
			out.write("[UNKNOWN]igb = " + igb[id] + line);
			cache.qb();
			jgb[id] = cache.vb();
			out.write("[UNKNOWN]jgb = " + jgb[id] + line);
			kgb[id] = no(cache.wb());
			out.write("[UNKNOWN]kgb = " + kgb[id] + line);
			itemPictureMask[id] = cache.rb();
			/* Makes Rune back to the teal color.
			if (lgb[id] == 13408690) {
				lgb[id] = 65535;
			}
			*/
			out.write("\t<itemPictureMask>" + itemPictureMask[id] + "</itemPictureMask>" + line);
			mgb[id] = cache.vb();
			out.write("[UNKNOWN]mgb = " + mgb[id] + line);
			ngb[id] = cache.vb();
			out.write("[UNKNOWN]ngb = " + ngb[id] + line);
			out.write("</itemDef>" + line + line);
		}
		out.close();
		cache.closeStream();
	}

	public static void loadObjects(CacheLoader cachedObjects) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Objects.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		String line = System.getProperty("line.separator");
		cachedObjects.qb();
		int objectCount = cachedObjects.vb();
		aib = objectCount;
		System.out.println("Found " + objectCount + " GameObjects");
		objectName = new String[objectCount][];
		description = new String[objectCount];
		command1 = new String[objectCount];
		command2 = new String[objectCount];
		objectID = new int[objectCount];
		gib = new int[objectCount];
		hib = new int[objectCount];
		iib = new int[objectCount];
		jib = new int[objectCount];
		groundItemVar = new int[objectCount];
		for (int id = 0; id < objectCount; id++) {
			try {
				cachedObjects.qb();
				int k = cachedObjects.vb();
				objectName[id] = new String[k];
				for (int type = 0; type < k; type++) {
					objectName[id][type] = cachedObjects.wb();
					
					/*
					 * Loop for dumping data
					 */
					if (k == 1) {
						out.write("<objectDef>" + line + "\t<objectName>" + objectName[id][type] + "</objectName>" + line);
					} else {
						for (int i = 0; i < type; i++) {
							out.write("<objectDef>" + line + "\t<objectName>" + objectName[id][i] + "</objectName>" + line + "\t<objectType>" + objectName[id][type] + "</objectType>" + line);
						}
					}
					//out.write("bib[j][l] = " + objectName[id][type] + line);
				}

				description[id] = cachedObjects.wb();
				out.write("cib[j] = " + description[id] + line);
				cachedObjects.qb();
				objectID[id] = loadModel(cachedObjects.wb());
				out.write("fib[j] = " + objectID[id] + line);
				gib[id] = cachedObjects.vb();
				out.write("gib[j] = " + gib[id] + line);
				hib[id] = cachedObjects.vb();
				out.write("hib[j] = " + hib[id] + line);
				iib[id] = cachedObjects.vb();
				out.write("iib[j] = " + iib[id] + line);
				jib[id] = cachedObjects.vb();
				out.write("jib[j] = " + jib[id] + line);
				command1[id] = cachedObjects.wb();
				if (command1[id].equals("_")) {
					command1[id] = "WalkTo";
				}
				out.write("dib[j] = " + command1[id] + line);
				command2[id] = cachedObjects.wb();
				if (command2[id].equals("_")) {
					command2[id] = "Examine";
				}
				out.write("eib[j] = " + command2[id] + line);
				groundItemVar[id] = cachedObjects.vb();
				out.write("kib[j] = " + groundItemVar[id] + line);
				
				out.write("</ObjectDef>" + line + line);
			} catch (IOException e) {
			}
		}
		out.close();
		cachedObjects.closeStream();
	}

	public static void loadBoundarys(CacheLoader cachedBoundarys) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Boundarys.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		cachedBoundarys.qb();
		int i = cachedBoundarys.vb();
		lib = i;
		System.out.println("Found " + i + " boundaries");
		mib = new String[i][];
		nib = new String[i];
		oib = new String[i];
		pib = new String[i];
		qib = new int[i];
		rib = new int[i];
		sib = new int[i];
		tib = new int[i];
		uib = new int[i];
		vib = new int[i];
		for (int j = 0; j < i; j++) {
			cachedBoundarys.qb();
			int k = cachedBoundarys.vb();
			mib[j] = new String[k];
			for (int l = 0; l < k; l++) {
				mib[j][l] = cachedBoundarys.wb();
			}

			nib[j] = cachedBoundarys.wb();
			cachedBoundarys.qb();
			qib[j] = cachedBoundarys.vb();
			rib[j] = cachedBoundarys.vb();
			sib[j] = cachedBoundarys.vb();
			tib[j] = cachedBoundarys.vb();
			uib[j] = cachedBoundarys.vb();
			vib[j] = cachedBoundarys.vb();
			oib[j] = cachedBoundarys.wb();
			if (oib[j].equals("_")) {
				oib[j] = "WalkTo";
			}
			pib[j] = cachedBoundarys.wb();
			if (pib[j].equals("_")) {
				pib[j] = "Examine";
			}
		}

		cachedBoundarys.closeStream();
	}

	public static void loadRoof(CacheLoader cachedRoof) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Roofs.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		cachedRoof.qb();
		int i = cachedRoof.vb();
		wib = i;
		System.out.println("Found " + i + " roofs");
		xib = new String[i];
		yib = new int[i];
		zib = new int[i];
		ajb = new int[i];
		for (int j = 0; j < i; j++) {
			cachedRoof.qb();
			xib[j] = cachedRoof.wb();
			yib[j] = cachedRoof.vb();
			zib[j] = cachedRoof.vb();
			ajb[j] = cachedRoof.vb();
		}

		cachedRoof.closeStream();
	}

	public static void loadFloors(CacheLoader cachedFloors) throws IOException {
		FileWriter asd = new FileWriter(new File("documents" + File.separator + "Floors.xml"));
		BufferedWriter out = new BufferedWriter(asd);
		cachedFloors.qb();
		int i = cachedFloors.vb();
		bjb = i;
		System.out.println("Found " + i + " floors");
		cjb = new String[i];
		djb = new int[i];
		ejb = new int[i];
		fjb = new int[i];
		for (int j = 0; j < i; j++) {
			cachedFloors.qb();
			cjb[j] = cachedFloors.wb();
			djb[j] = cachedFloors.vb();
			ejb[j] = cachedFloors.vb();
			fjb[j] = cachedFloors.vb();
		}

		cachedFloors.closeStream();
	}

	public static int no(String arg0) {
		if (arg0.equalsIgnoreCase("na")) {
			return -1;
		}
		for (int i = 0; i < totalEntities; i++) {
			if (arg0.equalsIgnoreCase(animationName[i])) {
				return i;
			}
		}

		System.out.println("WARNING: unable to match entity " + arg0);
		return 0;
	}

	public static int loadModel(String arg0) {
		if (arg0.equalsIgnoreCase("na")) {
			return 0;
		}
		for (int i = 0; i < lkb; i++) {
			if (mkb[i].equalsIgnoreCase(arg0)) {
				return i;
			}
		}

		mkb[lkb++] = arg0;
		return lkb - 1;
	}

	public static int go(String arg0) {
		if (arg0.equalsIgnoreCase("na")) {
			return 0;
		}
		for (int i = 0; i < totalItems; i++) {
			for (int j = 0; j < itemNames[i].length; j++) {
				if (itemNames[i][j].equalsIgnoreCase(arg0)) {
					return i;
				}
			}

		}

		System.out.println("WARNING: unable to match object: " + arg0);
		return 0;
	}

	public static int jo(String arg0) {
		if (arg0.equals("_")) {
			return -1;
		}
		for (int i = 0; i < gjb; i++) {
			if (ijb[i].equalsIgnoreCase(arg0)) {
				return i;
			}
		}

		System.out.println("WARNING: unable to match projectile: " + arg0);
		return -1;
	}

	public Cache() {
	}

	public final int sfb = 0xbc614e;
	public static int totalItems;
	public static int ufb;
	public static String itemNames[][];
	public static String itemExamine[];
	public static String xfb[];
	public static String itemCommand[];
	public static int ItemIDS[];
	public static int itemPrice[];
	public static int itemStackable[];
	public static int cgb[];
	public static int dgb[];
	public static int egb[];
	public static int fgb[];
	public static int ggb[];
	public static int hgb[];
	public static int igb[];
	public static int jgb[];
	public static int kgb[];
	public static int itemPictureMask[];
	public static int mgb[];
	public static int ngb[];
	public static int totalNpcs;
	public static String npcExamine[][];
	public static String npcName[];
	public static int npcAttack[];
	public static int npcStrength[];
	public static int npcDefense[];
	public static int npcHits[];
	public static int vgb[];
	public static int wgb[];
	public static int xgb[];
	public static int ygb[];
	public static int zgb[];
	public static int ahb[];
	public static int bhb[];
	public static int chb[];
	public static int dhb[];
	public static int ehb[];
	public static int fhb[];
	public static int npcSprites[][];
	public static int hhb[];
	public static int ihb[];
	public static int jhb[];
	public static int khb[];
	public static int camera1[];
	public static int camera2[];
	public static int npcWalkModels[];
	public static int npcCombatModels[];
	public static int npcCombatSprites[];
	public static int npcDropID[][];
	public static int npcDropAmount[][];
	public static int totalEntities;
	public static String animationName[];
	public static String animationType[];
	public static int animationColor[];
	public static int genderModel[];
	public static int xhb[];
	public static int animationNumber[];
	public static int zhb[];
	public static int aib;
	public static String objectName[][];
	public static String description[];
	public static String command1[];
	public static String command2[];
	public static int objectID[];
	public static int gib[];
	public static int hib[];
	public static int iib[];
	public static int jib[];
	public static int groundItemVar[];
	public static int lib;
	public static String mib[][];
	public static String nib[];
	public static String oib[];
	public static String pib[];
	public static int qib[];
	public static int rib[];
	public static int sib[];
	public static int tib[];
	public static int uib[];
	public static int vib[];
	public static int wib;
	public static String xib[];
	public static int yib[];
	public static int zib[];
	public static int ajb[];
	public static int bjb;
	public static String cjb[];
	public static int djb[];
	public static int ejb[];
	public static int fjb[];
	public static int gjb;
	public static int hjb;
	public static String ijb[];
	public static String jjb[];
	public static int kjb[];
	public static int ljb[];
	public static int mjb[];
	public static int njb[];
	public static int ojb[];
	public static int pjb[];
	public static int qjb;
	public static String rjb[];
	public static String sjb[];
	public static int tjb[];
	public static int ujb[];
	public static int vjb[];
	public static int wjb[];
	public static int xjb[][];
	public static int yjb[][];
	public static int totalShops;
	public static String shopName[];
	public static int bkb[];
	public static int ckb[];
	public static int dkb[];
	public static int ekb[];
	public static int fkb[];
	public static int shopItemID[][];
	public static int shopItemAmount[][];
	public static int shopItemPrice[][];
	static String skills[] = { "attack", "defense", "strength", "hits",
			"ranged", "prayer", "magic", "cooking", "woodcutting", "fletching",
			"fishing", "firemaking", "crafting", "smithing", "mining",
			"herblaw" };
	public static String combatRelatedSkills[] = { "attack", "defense", "damage", "hits", "agression", "bravery", "regenerate", "perception" };
	public static int lkb;
	public static String mkb[] = new String[200];

}
